package com.luo.backend.dto;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**
 * 修改邮箱请求
 */
public class ChangeEmailRequest {
    
    @NotBlank(message = "新邮箱不能为空")
    @Email(message = "邮箱格式不正确")
    private String newEmail;
    
    @NotBlank(message = "验证码不能为空")
    @Pattern(regexp = "\\d{6}", message = "验证码必须是6位数字")
    private String code;
    
    @NotBlank(message = "密码不能为空")
    private String password;
    
    // Constructors
    public ChangeEmailRequest() {
    }
    
    public ChangeEmailRequest(String newEmail, String code, String password) {
        this.newEmail = newEmail;
        this.code = code;
        this.password = password;
    }
    
    // Getters and Setters
    public String getNewEmail() {
        return newEmail;
    }
    
    public void setNewEmail(String newEmail) {
        this.newEmail = newEmail;
    }
    
    public String getCode() {
        return code;
    }
    
    public void setCode(String code) {
        this.code = code;
    }
    
    public String getPassword() {
        return password;
    }
    
    public void setPassword(String password) {
        this.password = password;
    }
}



